package cn.ratel.component;

import cn.ratel.route.HandlerContext;

import java.util.ArrayList;
import java.util.List;

public class Handlers {
	private static final List<Handler> handlers = new ArrayList<>();

	private static Handlers me = new Handlers();

	private Handlers() {
	}

	public static Handlers me() {
		return me;
	}

	public void addHandler(Handler handler) {
		handlers.add(handler);
	}

	public List<Handler> getHandlers() {
		return handlers;
	}

	public interface Handler {
		void handle(HandlerContext handlerContext);
	}
}
